<%-- 
    Document   : view-newitem-table
    Created on : 12 Mei 11, 15:18:47
    Author     : Bayu
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
       <jsp:include page="includes/script.html"/>
       <title>LIST NEW ITEM TAHUN ${year}</title>
    </head>

    <body>
        <center>
           
         <form method="get">

          Filter (Year) :
          <select name="year">
          <c:forEach var="i" begin="${minYear}" end="${maxYear}">
              <c:choose>
                <c:when test="${year == i}">
                    <c:set var="select" value="selected"></c:set>
                </c:when>
                <c:otherwise>
                    <c:set var="select" value=""></c:set>
                </c:otherwise>
               </c:choose>
              <option value="${i}" ${select}>${i}</option>
          </c:forEach>
        </select>
          <input type="submit" value="View Report">
        </form>
        </center>
        <br>
    <center>
        <h3>LIST NEW ITEM TAHUN ${year}</h3>
        <br>
        <table bgcolor="#000000" cellpadding="1" cellspacing="1" width="800">
            <tr bgcolor="#f3f7f6" align="center">
                    <td>No</td>
                    <td>Part Name</td>
                    <td>Part Number</td>
                    <td>Customer</td>
                    <td>Month</td>

                </tr>

            <c:if test="${size1 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data1}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size1}" align="center">
                            <fmt:formatDate pattern="MMMM" value="${data.date}" />
                        </td>
                         </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size1} Item</td>
                    </tr>
            </c:if>

            <c:if test="${size2 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data2}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size2}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size2} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size3 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data3}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size3}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size3} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size4 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data4}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size4}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size4} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size5 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data5}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size5}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size5} Item</td>
                    </tr>
            </c:if>

            <c:if test="${size6 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data6}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size6}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size6} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size7 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data7}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size7}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size7} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size8 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data8}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size8}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size8} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size9 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data9}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size9}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size9} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size10 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data10}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size10}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size10} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size11 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data11}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td align="center">${data.partNumber}</td>
                        <td>${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size11}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size11} Item</td>
                    </tr>
            </c:if>
                    <c:if test="${size12 > 0}">
                <c:set var="i" value="1"></c:set>
                <c:forEach items="${data12}" var="data">
                    <tr bgcolor="#ffffff">
                        <td align="center">${i}</td>
                        <td>${data.partName}</td>
                        <td>${data.partNumber}</td>
                        <td align="center">${data.customer}</td>
                        <c:if test="${i==1}">
                        <td rowspan="${size12}" align="center">

                            <fmt:formatDate pattern="MMMM" value="${data.date}" />

                        </td>
                        </c:if>
                    </tr>
                    <c:set var="i" value="${i+1}"></c:set>
                </c:forEach>
                    <tr bgcolor="#ffffff">
                        <td bgcolor="#ffff99" colspan="4" align="center">Total</td>
                        <td align="center">${size12} Item</td>
                    </tr>
            </c:if>

        </table>
        </center>

    </body>
</html>
